type Ids = number[];
type Names = string[];

type Unpacked<T> = T extends (infer R)[] ? R : T;

type idType = Unpacked<Ids>; // idType 类型为 number
type nameType = Unpacked<Names>; // nameType 类型为string


type NumberToString<T extends number> = `${T}`;
type Value = NumberToString<5>; // "5"

let aa: Value = '5'


type TrimLeft<T extends string> = T extends ` ${infer R}` ? TrimLeft<R> : T;
type Value1 = TrimLeft<"    value">; // "value"

type Foo<T> = T extends {
                          a: infer U;
                          b: infer U
                        } ? U : never;

type T10 = Foo<{
  a: string;
  b: string
}>; // T10类型为 string

type T11 = Foo<{
  a: string;
  b: number;
}>; // T11类型为 string | number


type ReverseArray<T extends unknown[]> = T extends [infer First, ...infer Rest]
  ? [...ReverseArray<Rest>, First]
  : T
type Value3 = ReverseArray<[1, 2, 3, 4]> // [4,3,2,1]

let aaa: Value3 = [4, 3, 2, 1]